<%--
  Created by IntelliJ IDEA.
  User: jia
  Date: 2018/4/4
  Time: 9:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!--使用spring jsp标签库：表单绑定库-->
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<!--spring通用标签库-->
<%@ taglib uri="http://www.springframework.org/tags" prefix="s"%>
<
<html>
<head>
    <title>Title</title>
</head>
<body>
    <h1>你好！</h1>

    <form:form action="" commandName="spittle" method="post">
        <!--渲染所有的错误-->
        <form:errors path="*" element="div" cssClass="errors"/><br/>
        <form:label path="username" cssErrorClass="error">用户名：</form:label>
        <form:input path="username" cssErrorClass="error"/><br/>
        <!--如果后台校验错误，erros则会展现username的校验结果，这样做会对布局造成影响-->
        <%--<form:errors path="username" cssClass="error"/><br/>--%>
        <form:label path="username" cssErrorClass="error">用户名：</form:label>
        <form:password path="password"/><br/>
        <form:input path="email" type="email"/><br/>
        <input type="submit" value="提交"/>
    </form:form>
</body>
</html>
